<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=0">
    <title>{block name="title"}{/block}{$mipInfo['siteName']}管理后台</title>
    <base href="{$domainRewrite}" />
    <link rel="stylesheet" href="https://cdn.bootcss.com/twitter-bootstrap/4.1.1/css/bootstrap.min.css">
    <link rel="stylesheet" type="text/css" href="https://cdnjs.cloudflare.com/ajax/libs/ionicons/2.0.1/css/ionicons.min.css"/>
    <link rel="stylesheet" type="text/css" href="https://cdn.bootcss.com/iview/2.13.1/styles/iview.css">
    <link rel="stylesheet" type="text/css" href="{$domainStatic}/{$assets}/admin/css/admin.css?v={:time()}"/>
    <style type="text/css">
      [v-cloak] {
        display: none;
        }
        .ivu-modal-close {
            z-index: 999;
        }
    </style>
    {block name="style"}
        
    {/block}
</head>
<body class="nice-admin">
    <section id="nicemip">
            
        <header id='header' class="nice-header clearfix b-b">
            <div class="nice-logo">
                <div class="nice-logo-a"><a href="{$domain}/{$Think.config.admin}/">管理系统后台</a><span class="sub-v"></span></div>
            </div>
            <ul class="header-switch">
                <li><a href="{$webUrl}" target="_blank" class="link"><Icon type="ios-home-outline"></Icon> 网站浏览</a></li>
                {nicemipitem:itemselect table='HeaderMenu' value='v'}
                <li class="link {if condition='$action==$v["name"]'}active{/if}"><a class="link" href="{$domain}/{$Think.config.admin}/{$v['admin_url']}" >{$v['title']}</a></li>
                {/nicemipitem:itemselect}
            </ul>
            <div class="nice-user-info" v-cloak>
                <ul class="nav navbar-nav navbar-right">
                     <Dropdown trigger="click" >
                        <a href="javascript:void(0)">
                            欢迎您,尊敬的 {$user_name}
                            <Icon type="arrow-down-b"></Icon>
                        </a>
                        <Dropdown-Menu slot="list">
                            <li class="ivu-dropdown-item" @click='editPassword'>修改密码</li>
                            <li class="ivu-dropdown-item" @click='loginOut'>安全退出</li>
                        </Dropdown-Menu>
                    </Dropdown>
                </ul>
            </div>
        </header>
        <main class="nice-main clearfix" >
                <aside id="menu" class="nice-menu hidden-xs">
                   <div class="menu-wrap">
                        <div class="menu-content sidebar-menu">
                            <ul class="sidebar-list">
                                {foreach name='$AdminMenu' id='v'}
                                    {if condition='$v.html'}
                                        {$v.html}
                                    {/if}
                                {/foreach}
                            </ul>
                        </div>
                    </div>
                </aside>
                <section class="nice-container" id="app">
                    {block name="main"}
                    {/block}
                </section>
          </main>
      
    </section>
    {block name="dialog"}{/block}
</body>
{block name="javascript"}
<script type="text/javascript">
    var mipGlobal = {
        domain: '{$domain}',
        rewrite: '{$rewrite}',
        mipInfo: {$mipInfoToJson},
    }
</script>
<script src="https://cdn.bootcss.com/babel-polyfill/7.0.0-beta.49/polyfill.min.js"></script>
<script src="https://cdn.bootcss.com/vue/2.5.17/vue.min.js"></script>
<script src="https://cdn.bootcss.com/axios/0.18.0/axios.min.js"></script>
<script src="https://cdn.bootcss.com/iview/3.1.4/iview.min.js"></script>
<script src="https://cdn.bootcss.com/vue-router/3.0.1/vue-router.min.js"></script>
<script src="https://cdn.bootcss.com/jquery/1.11.1/jquery.min.js"></script>
<script src="{$domainStatic}/{$assets}/admin/js/nicemip-admin.js" type="text/javascript" charset="utf-8"></script>
<script type="text/javascript">
	$(document).ready(function() {
    var animationSpeed = 200;
    $('.sidebar-menu').on('click', 'li.has-sub>a', function(e) {
    	//判断用户是否配置mip化域名
    	var mipDomain = "{$mipDomain}";
    	if(mipDomain == ''){
    		alert('请您先配置相关信息');
    		return false;
    	}else{
	        e.preventDefault();
	        var $this = $(this);
	        var nextElem = $(this).next();
	        if (nextElem.parent("li").is('.active')) {
	            nextElem.css('display','block');
	            nextElem.slideUp(animationSpeed, function() {
	                //收起
	                nextElem.parent("li").removeClass("active");
	            });
	        } else {
	            var subUl = $('.sidebar-menu .has-sub');
	            subUl.find('ul:visible').slideUp(animationSpeed, function() {
	                //收起
	                subUl.removeClass("active");
	            });
	            nextElem.slideDown(animationSpeed, function() {
	                //展开
	                nextElem.parent("li").addClass("active");
	            });
	        }
    	}
      });
});
</script>
<script type="text/javascript">
	 new Vue({
        el: '#header',
        data: {
            displayBlick: true,
        },
        watch: {
        },
        mounted() {
        },
        methods: {
            loginOut() {
               this.$nicemip.ajax('{$domain}/user/ApiUserUser/loginOut', {
                }).then(res => {
                    if (res.code == 1) {
                        this.$Message.error(res.msg);
                        location.href = '{$domain}/';
                    }
                });
            },
            editPassword() {
                location.href = '{$domain}/{$Think.config.admin}/user/account';
            }
         }
    })
</script>
{/block}


</html>